package com.company.bookstore.entities.user_admin_module;

import com.baomidou.mybatisplus.annotation.*;
import com.company.bookstore.entities.book_module.Book;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

//https://blog.csdn.net/zhou520yue520/article/details/81348926
@Builder
@Data
@TableName("t_schedule")
@NoArgsConstructor
@AllArgsConstructor
public class Schedule {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String corn;
    @TableField(fill = FieldFill.INSERT)
    private Integer status;
//    2018-08-02 22:05:55
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
//            timezone = "GMT+8"
    )
    private Date startTime;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
//            timezone = "GMT+8"
    )
    private Date endTime;
    private Integer fkBookId;
//    private Float second;
    @TableField(exist = false)
    @Transient
    private String bookName;

    @TableField(exist = false)
    @Transient
    private Book book;

    @TableField(exist = false)
    @Transient
    private Double killPrice;

}
